package uml.behavioral.responsibility_chain;

/**
 * 职责链--抽象处理者<br>
 * on 2023/1/1 1:31
 */
public class Congress extends Approver {
    public Congress(String name) {
        super(name);
        this.job = "董事会";
    }

    @Override
    public void dealWith(PurchaseRequest request) {
        if (request.getAmount() >= 15 && request.getAmount() <= 100) {
            this.agree(request);
        } else {
            this.refuse(request);
        }
    }
}
